<template>
  <div class="nav" v-if="isShow">
    <!-- 底部导航栏 -->
    <ul>
      <router-link to="/film" tag="li" active-class="active">
        <i class="iconfont icon-dianying"></i>
        <p>影片</p>
      </router-link>
      <router-link to="/cinemas" tag="li" active-class="active">
        <i class="iconfont icon-yingyuan"></i>
        <p>影院</p>
      </router-link>
      <router-link to="/zixun" tag="li" active-class="active">
        <i class="iconfont icon-zixun"></i>
        <p>资讯</p>
      </router-link>
      <router-link to="/center" tag="li" active-class="active">
        <i class="iconfont icon-31wode"></i>
        <p>我的</p>
      </router-link>
    </ul>
  </div>
</template>

<script setup>
import bus from 'vue3-eventbus'
import { ref } from "@vue/reactivity";
import { getCurrentInstance } from '@vue/runtime-core';

let isShow=ref(true)

function  created() {
  console.log(getCurrentInstance());
  bus.on("footerShow", (val) => {
    console.log(val);
      isShow.value = val;
    });
  }
  created()
</script>

<style lang="less" scoped>
.nav {
  position: fixed;
  bottom: 0;
  left: 0;
  border-top: 1px solid #ccc;
  height: 50px;
  text-align: center;
  background: #fff;
  color: #7a7e83;
  width: 100%;

  ul {
    display: flex;
    justify-content: space-around;
    align-content: center;
    align-items: center;
    height: 50px;

    a {
      margin-top: 5px;
      flex: 1;
      height: 43px;
      color: #333;

      p {
        margin-top: 2px;
      }

      i {
        font-size: 20px;
      }
    }

    .active {
      color: #fe5100;
    }
  }
}
</style>
